Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jimmy Dan Mortensen 77 posts 197 karma points
    Dec 16, 2011 @ 14:05
    Jimmy Dan Mortensen
    0

    If true { run Razor-Macro1} Else {run Razor-Macro2}

    Basically I'm trying to create it so that if I have selected a media-item (Property-field on my document-type) it shall show the img and If I haven't selected any media it shall run a Razor Macro instead.

    Any ideas?

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Dec 16, 2011 @ 14:09
    Sebastiaan Janssen
    0

    You can do this with RenderPage:

    @if(myBoolean) { 
    <img src="blank.gif" />
    } else {
    @RenderPage("~/macroScripts/MyOtherRazorMacro.cshtml")
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies